package com.study.talk.module.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.study.talk.module.entity.Message;
import org.apache.ibatis.annotations.Select;
import org.mapstruct.Mapper;

import java.util.*;

/**
 * <p>
 *  mapper接口
 * </p>
 *
 * @author thor
 * @since 2023-12-18
 */
@Mapper
public interface MessageMapper extends BaseMapper<Message> {

    @Select("select * from message where status=1 AND user_id=#{userId} LIMIT 0,500")
    List<Message> getMessageListByUserId(Integer userId);

    @Select("delete from message where user_id=#{userId}")
    void deleteMessageByUserId(Integer userId);

}
